package com.funkids.config;

import org.springframework.amqp.core.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Collection;
import java.util.Map;

@Configuration
public class RabbitmqConfig {

    private static final String TOPIC_EXCHANGE = "exchangeT";
    private static final String ROUTIN_KEY_1 = "seckill.#";



    @Bean
    public Queue queue(){
        return new Queue("queue",true);
    }

    @Bean
    public TopicExchange exchange(){
        return new TopicExchange(TOPIC_EXCHANGE);
    }

    @Bean
    public Binding binding(){
        return BindingBuilder.bind(queue()).to(exchange()).with(ROUTIN_KEY_1);
    }

}
